const { defineConfig } = require("@vue/cli-service");
const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')
module.exports = defineConfig({
  productionSourceMap: false,  //剔除map文件
  transpileDependencies: true,
  lintOnSave: false,//取消语法检测
  configureWebpack: {
    plugins: [
      AutoImport({
        resolvers: [ElementPlusResolver({ importStyle: false })],
      }),
      Components({
        resolvers: [ElementPlusResolver()],
      }),
    ]
  },
  devServer: {
    // host: "localhost",
    // port: 8080, // 端口号
    https: false, // https:{type:Boolean}
    open: false, //配置自动启动浏览器
    proxy: {
      '/m.api': { //代理api
        target: 'http://www.zxwyit.cn:8080',//服务器api地址
        // ws: true,// proxy websockets?
        changeOrigin: true,//是否跨域
        // pathRewrite: { //重写路径
        //   '^/api': ''
        // }
      },
      '/upload/admin': { //代理api
        target: 'http://www.zxwyit.cn:8080', //服务器api地址
        // ws: true,// proxy websockets
        changeOrigin: true,//是否跨域
        // pathRewrite: { //重写路径
        //   '^/api': ''
        // }
      }
    }
  }
});
